using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Vue_AspNetCore_Project.Models
{
    public class Order
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Display(Name = "主题")]
        [StringLength(200)]
        public string Title { get; set; }

        [Display(Name = "订单号")]
        [StringLength(100)]
        [Required]
        public string OrderNo { get; set; }

        [Display(Name = "类型")]
        [StringLength(200)]
        public string Category { get; set; }

        [Display(Name = "订单金额")]
        [Required]
        [Column(TypeName = "decimal(18,4)")]
        public decimal Amount { get; set; }

        [Display(Name = "订单数量")]
        public int? Quantity { get; set; }

        [Display(Name = "过期日期")]
        public DateTime? ExpireDate { get; set; }


        [Required]
        [Display(Name = "计费模式")]
        public int ChargeMode { get; set; }

        [Required]
        [ForeignKey("User")]
        public int UserId { get; set; }

        public ApplicationUser User { get; set; }


        [Display(Name = "客户要求")]
        [StringLength(200)]
        public string Comments { get; set; }


        [Display(Name = "状态")]
        [Required]
        [DefaultValue(0)]
        public int Status { get; set; }


        public DateTime CreatedTime { get; set; }
        public DateTime UpdatedTime { get; set; }

        [StringLength(100)]
        public string CreatedBy { get; set; }
        [StringLength(100)]
        public string UpdatedBy { get; set; }

    }
}